﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hi_Baidu.Entry.Base;

namespace Hi_Baidu.Plugin
{
    /// <summary>
    ///     所有插件基类 - 提供了插件的基本相关操作
    /// </summary>
    public abstract class Plugin : IPlugin
    {
        private User forUser;
        /// <summary>
        ///     当前登陆用户
        /// </summary>
        public User ForUser
        {
            get { return forUser; }
            set { forUser = value; }
        }

        private Object tag;
        /// <summary>
        ///     插件附属对象
        /// </summary>
        public Object Tag
        {
            get { return tag; }
            set { tag = value; }
        }

        protected String name;
        /// <summary>
        ///     插件名称
        /// </summary>
        public String Name
        {
            get { return name; }
        }

        protected String description;
        /// <summary>
        ///     插件描述
        /// </summary>
        public String Description
        {
            get { return description; }
        }

        protected String author;
        /// <summary>
        ///     插件作者
        /// </summary>
        public String Author
        {
            get { return author; }
        }

        protected String version;
        /// <summary>
        ///     插件版本
        /// </summary>
        public String Version
        {
            get { return version; }
        }

        #region IPlugin 成员

        public abstract void Initialize();

        public abstract void Dispose();

        public abstract Plugin.PLUGIN_TYPE GetPluginType();

        public abstract Plugin.PLUGIN_HOST GetPluginHost();

        public abstract PLUGIN_KEY GetPluginKey();

        #endregion

        #region IMetaData 成员

        private String key;
        public string Key
        {
            get
            {
                return key;
            }
            set
            {
                key = value;
            }
        }

        #endregion

        /// <summary>
        ///     插件宿主
        /// </summary>
        public enum PLUGIN_HOST
        {
            /// <summary>
            ///     主窗体
            /// </summary>
            MAIN_WINDOW,
            /// <summary>
            ///     聊天窗口
            /// </summary>
            TALK_WINDOW
        }
        
        /// <summary>
        ///     插件唯一标示
        /// </summary>
        public enum PLUGIN_KEY
        {
            PLUGIN_VIDEO,
            PLUGIN_FILESHARE
        }

        /// <summary>
        ///     插件类别
        /// </summary>
        public enum PLUGIN_TYPE
        {
            /// <summary>
            ///     纯窗体插件
            /// </summary>
            WINDOW_PLUGIN,
            /// <summary>
            ///     纯网络插件
            /// </summary>
            NETWORK_PLUGIN,
            /// <summary>
            ///     带有网络的窗体插件
            /// </summary>
            BOTH
        }
    }
}
